package zhou.contest10;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import jin.competition.jan11.User;

public class BaseDao {
//	public static void main(String[] args) {}	
		String driver="com.mysql.jdbc.Driver";
		String database="java3";
		String userName="root";
		String pwd="shi";		
		String url="jdbc:mysql://localhost:3306/"+database;
		//String sql="select name,height from car where color='red'";
		
		Connection con=null;

		public Connection getCon(){

				try {
					Class.forName(driver);				
					con=DriverManager.getConnection(url,userName,pwd);
				} catch (ClassNotFoundException | SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				return con;
							
		}
	
	
	}	
	
	


